﻿@model StripeDemo.Models.Cards

@{
    ViewBag.Title = "Index";
}

<h2>StripeDemo</h2>


@using (Html.BeginForm(Html.BeginForm("Create", "Cards", FormMethod.Post, new { @class = "form-horizontal", role = "form" })))
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        <h4>@ViewBag.Msg</h4>
        <hr />
        @Html.ValidationSummary(true)

        <div class="form-group">
            @Html.LabelFor(model => model.CustomerId, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.CustomerId)
                @Html.ValidationMessageFor(model => model.CustomerId)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.CardNumber, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextAreaFor(model => model.CardNumber, new { cols = 35, @rows = 3 })
                @Html.ValidationMessageFor(model => model.CardNumber)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.CVC, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.CVC)
                @Html.ValidationMessageFor(model => model.CVC)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.ExpiresMonth, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.ExpiresMonth)
                @Html.ValidationMessageFor(model => model.ExpiresMonth)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.ExpiresYear, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.ExpiresYear)
                @Html.ValidationMessageFor(model => model.ExpiresYear)
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Create" class="btn btn-default" />
            </div>
        </div>
    </div>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
